import javax.print.attribute.standard.PrinterName;

class father{
	private String name;
	public father(String name) {
		this.name=name;
		System.out.println("This is a father");
	}
	public void PrintName(){
		System.out.println("father's name is "+name);
	}
}
class son extends father{
	private String name;
	public son(String name) {
		super(name);
		this.name=name;
		System.out.println("This is a son");
	}
	public void PrintName() {
		//super.PrintName();
		System.out.println("son's name is "+name);
	}
}
public class 方法重写 {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		father father=new father("father");
		father.PrintName();
		father son=new son("son");
		son.PrintName();
	}

}
